<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    var x = 100;
    function fn() {
      x += 10;
      console.log(x);
    }
    fn();
    console.log(x);
    function fn1() {
      x *= 10;
      fn();
      console.log(x);
    }
    fn1();
    console.log(x);

    window.y = "abc";//window也是全局变量
    z = true//window. 可以省略不写
    console.log(y);
    console.log(z);
    console.log(window);
  </script>
</html>
